home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Loadstar 85
/
085.d81
/
i-prg source
< prev
next >
Wrap
Text File
|
2022-08-26
|
18KB
|
1,609 lines
.org $c000
;mem
;dis
.obj "@0:i-prg c000"
jmp over; 49152
jmp i'menu; 49155
jmp stash; 49158
jmp restore; 49161
jmp screen'disk; 49164
jmp spill'guts; 49167
jmp gut'out'screen; 49170
jmp change'menu'mode; 49173
jmp directory; 49176
jmp fill'box; 49179
jmp get'device'prompt
jmp get'command
jmp reconnect
jmp user'message
over lda #0
sta name'flag
lda #255
sta mode
clear'header ldy #39
lda #160
- sta header'memory,y
dey
bpl -
main lda main'background
sta 53281
lda main'border
sta 53280
jsr print'header
jsr print'entry'box
bit name'flag
bmi enter'i'menu
jmp get'prg'name
enter'i'menu jsr gut'out'screen
jsr print'main'menu
print'device'number lda number+5
sta 646
ldx #11
ldy #29
clc
jsr $fff0
ldx device
lda #0
sta remember
jsr $bdcd
don't'save'screen lda #65
sta number+8
jsr da'box
main'get jsr $ffe4 ;get menu selection
sta temp
cmp #"1"
beq exit'main
cmp #"2"
beq set'default'device
cmp #"3"
beq dir
cmp #"4"
beq disk'command
cmp #"5"
beq customize
cmp "6"
beq help
cmp #"7"
beq let's'book
exit'main lda temp
sta 631
lda #1
sta 198
lda number+5
sta 646
rts
set'default'device jsr get'device'prompt
jmp enter'i'menu
dir jsr directory
jmp enter'i'menu
disk'command jsr get'command
jmp main
customize jsr get'custom'menu
jmp main
help lda #0
sta 198
sta screen
sta number
jsr screen'restore
- jsr $ffe4
beq -
jmp main
let's'book jmp reconnect
i'menu lda #0
sta remember
ldx #6
stx numbers'to'get
jsr get'number
lda number
sta number+8
and #31
sta number
bit number+8
bvs check'x'range
bmi check'x'range
jsr save'screen
check'x'range lda number+1
bne +
jsr x'out
+ lda number+3
bne +
jsr x'out
+ jsr line'links
lda #0
sta max
ldx number+2
ldy number+1
clc
jsr $fff0
lda number+5
sta 646
lda number
sta digit
- jsr get'string
dec digit
bne -
beq da'box
menu'jump jmp menu
da'box bit number+3
bmi menu'jump
box ldx number+2
dex
ldy number+1
dey
clc
jsr $fff0
lda number+3
sta 646
lda #176
jsr $ffd2
- lda #96
jsr $ffd2
lda 211
cmp max
bne -
lda #174
jsr $ffd2
inc 214
lda number
sta digit
line ldx number+1
dex
stx 211
jsr 58732
lda #125
jsr $ffd2
lda max
sta 211
jsr 58732
lda #125
jsr $ffd2
bit number+3
bvc after'double
lda digit
cmp #1
beq after'double
inc 214
ldx number+1
dex
stx 211
jsr 58732
lda #171
jsr $ffd2
- lda #96
jsr $ffd2
lda 211
cmp max
bne -
lda #179
jsr $ffd2
after'double inc 214
dec digit
bne line
lda number+1
sta 211
dec 211
jsr 58732
lda #173
jsr $ffd2
- lda #96
jsr $ffd2
lda 211
cmp max
bne -
lda #189
jsr $ffd2
menu lda remember
sta item
sta current
sta previous
lda number+2
clc
adc remember
tax
ldy #0
clc
jsr $fff0
lda number+4
sta digit
jsr highlight'routine
get'key jsr $ffe4
beq get'key
cmp #29
beq crsr'quit
cmp #157
beq crsr'quit
cmp #17
beq crsr'down
cmp #145
beq crsr'up
cmp #13
beq quit
cmp #49
bcc get'key
cmp #58
bcs get'key
number'key'pressed sec
sbc #49
tay
cpy number
bcs get'key
lda item
sta previous
sty item
jsr highlight
- bit 197
bvc -
quit lda item
clc
adc #49
sta 631
lda #1
sta 198
bit number+8
bvs +
bmi +
lda #4
sta screen
jsr screen'restore
lda device
sta 186
+ jmp line'links
crsr'quit bit mode
bvs get'key
sta 631
lda #1
sta 198
rts
crsr'up lda item
sta previous
sec
sbc #1
bpl +
ldx number
dex
txa
+ sta item
jsr highlight
jmp get'key
crsr'down lda item
sta previous
clc
adc #1
cmp number
bne +
lda #0
+ sta item
jsr highlight
jmp get'key
highlight lda previous
bit number+3
bvc +
asl
+ clc
adc number+2
bit number+3
tax
ldy #0
jsr $fff0
lda number+5
sta digit
jsr highlight'routine
lda item
bit number+3
bvc +
asl
+ clc
adc number+2
tax
ldy #0
jsr $fff0
lda number+4
sta digit
highlight'routine ldy number+1
- lda (209),y
eor #128
sta (209),y
lda digit
sta (243),y
iny
cpy max
bne -
rts
;**** get number from BASIC ****
get'number ldx #0
stx current'number
- jsr $aefd
jsr $ad8a
jsr $b7f7
lda $14 ; got it!
ldx current'number
sta number,x
inc current'number
dec numbers'to'get
beq +
bne -
+ rts
;***** get string from BASIC ****
get'string jsr general'string
cmp #41
bcc +
lda #40
+ sta string'length
lda number+1
sta 211
jsr 58732
ldy #0
- lda ($22),y
jsr $ffd2
iny
cpy string'length
bne -
lda 211
cmp max
bcc +
sta max
+ inc 214
bit number+3
bvc +
inc 214
+ jsr 58732
lda max
cmp #41
bcc +
jsr x'out
+ lda 214
cmp #24
bcc +
jsr x'out
+ rts
;**** Line Links ****
line'links ldy #24
- lda 217,y
ora #128
sta 217,y
dey
bpl -
rts
print'header lda #147
jsr $ffd2
print'header'2 lda #19
jsr $ffd2
ldy #39
- lda #239
sta (209),y
lda header'1
sta (243),y
dey
bpl -
lda #13
jsr $ffd2
ldy #119
- lda #160
sta (209),y
lda header'2
sta (243),y
dey
bpl -
lda #13
jsr $ffd2
ldy #39
- lda header'memory,y
sta (209),y
dey
bpl -
inc 214
inc 214
jsr 58732; fix cursor and pointer
ldy #39
- lda #247
sta (209),y
lda header'3
sta (243),y
dey
bpl -
rts
print'entry'box ldx #22
ldy #0
clc
jsr $fff0
ldy #0
lda #112
sta (209),y
lda header'2
sta (243),y
ldy #39
sta (243),y
lda #110
sta (209),y
dey
- lda #64
sta (209),y
lda header'2
sta (243),y
dey
bne -
lda #13
jsr $ffd2
lda header'2
sta (243),y
lda #93
sta (209),y
ldy #39
sta (209),y
lda header'2
sta (243),y
lda #13
jsr $ffd2
ldy #38
- lda #64
sta (209),y
lda header'2
sta (243),y
dey
bne -
sta (243),y
lda #109
sta (209),y
ldy #39
lda #125
sta (209),y
lda header'2
sta (243),y
lda #19
jmp $ffd2
print'main'menu ldy #7
- lda main'menu'parameters,y
sta number,y
dey
bpl -
lda number+2
sta 214
jsr 58732
lda #30
sta string'length
lda number+1
sta 211
jsr 58732
ldy #0
sty max
lda number+5
sta 646
- lda default'menus,y
beq ++
jsr $ffd2
cmp #13
bne +
sty temp
lda number+1
sta 211
inc 214
jsr 58732
ldy temp
+ iny
bne -
+ lda 211
cmp max
bcc print'prompt
sta max
print'prompt ldx #23
ldy #2
clc
jsr $fff0
lda number+4
sta 646
ldy #0
- lda the'prompt,y
beq +
jsr $ffd2
iny
bne -
+ rts
erase'box ldy #0
ldx #23
clc
jsr $fff0
ldy #38
lda #32
- sta (209),y
dey
bne -
rts
;**** wait ****
wait lda 53265
bpl wait
rts
;**** SCREEN STASH ****
screen'stash ldy screen
cpy #9 ; ahem! there are only 9 screens (0-8)
bcc +
rts
+ sei
ldx #0
lda 1
sta temp
stx 1
lda screens,y
stx 253
sta 254; dest screen
lda 648
sta 252; source screen
ldy #0
sty 251
;begin copying
- lda (251),y
sta (253),y
iny
bne -
inx
inc 254
inc 252
cpx #4
bne -
ldx #0
lda #>55296
sta 252
- dec 1
lda (251),y
inc 1
sta (253),y
iny
bne -
inc 252
inc 254
inx
cpx #4
bne -
lda temp
sta 1
cli
lda 53280
ldy number
sta border,y
lda 53281
sta background,y
rts
screen'restore ldy screen
cpy #9 ; ahem! there are only 9 screens (0-8)
bcc +
rts
/ lda 53265
bpl -
sei
ldx #0
lda 1
sta temp
stx 1
lda screens,y
stx 253
sta 254; source screen
lda 648
sta 252; dest screen
ldy #0
sty 251
;begin copying
- lda (253),y
sta (251),y
iny
bne -
inx
inc 254
inc 252
cpx #4
bne -
ldx #0
lda #>55296
sta 252
- lda (253),y
dec 1
sta (251),y
inc 1
iny
bne -
inc 252
inc 254
inx
cpx #4
bne -
lda temp
sta 1
cli
ldy number
lda border,y
sta 53280
lda background,y
sta 53281
rts
x'out lda number+3
ora #128
sta number+3
rts
get'device'prompt jsr save'screen
jsr erase'box
ldy #6
ldx #23
clc
jsr $fff0
lda number+4
sta 646
ldy #0
- lda device'prompt,y
beq print'device'menu
jsr $ffd2
iny
bne -
print'device'menu ldy #2
- lda device'parameters,y
sta number,y
dey
bpl -
lda number+3
and #15
sta number+3
lda number+2
sta 214
lda number+1
sta 211
jsr 58732
lda #15
sta string'length
ldy #0
sty max
lda number+5
sta 646
- lda device'menu,y
beq ++
jsr $ffd2
cmp #13
bne +
sty temp
lda number+1
sta 211
jsr 58732
ldy temp
+ iny
bne -
+ lda 211
cmp max
bcc +
sta max
+ jsr da'box
jsr $ffe4
sec
sbc #41
sta device
sta 186
jsr check'device
lda status
bpl +
jmp print'device'menu
+ lda #4
sta screen
jmp screen'restore
get'command jsr input
jmp command
get'custom'menu jsr save'screen
print'custom'menu ldy #2
- lda custom'parameters,y
sta number,y
dey
bpl -
lda number+3
and #15
sta number+3
lda number+2
sta 214
lda number+1
sta 211
jsr 58732
lda #22
sta string'length
ldy #0
sty max
lda number+5
sta 646
- lda customize'menu,y
beq ++
jsr $ffd2
cmp #13
bne +
sty temp
lda number+1
sta 211
jsr 58732
ldy temp
+ iny
bne -
+ lda 211
cmp max
bcc +
sta max
+ jsr da'box
jsr $ffe4
tay
sec